<%--
    Document   : payBill
    Created on : 01/11/2010, 12:12:43 AM
    Author     : Luke
--%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<jsp:useBean id="accounts" class="java.util.Map" scope="session"/>
<jsp:useBean id="selectedBill" class="au.edu.swin.bank.persistence.entity.BillDTO" scope="session"/>

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>SwinBank - Bill Payment</title>
    </head>
    <body>
        <h1>SwinBank - Bill Payment</h1>
        <hr />
        <div id="message" style="color: red;"><%= (session.getAttribute("billPaymentMessage") != null) ? session.getAttribute("billPaymentMessage") : "" %></div>
        <form action="processBillPayment" method="post">
            <p>From Account:
                <select name="fromAccountId">
                    <c:forEach var="account" items="${accounts}">
                        <option value="${account.key}"><c:out value="${account.key}"/> ($<c:out value="${account.value}"/>)</option>
                    </c:forEach>
                </select>
            </p>
            <p>To Account: <input type="text" name="billerAccountId" readonly="readonly" value="${selectedBill.getBillerAccountId()}"/> (Biller Name: <c:out value="${selectedBill.getBillerName()}"/>)</p>
            <p>Amount ($): <input type="text" name="amount"/> (Amount Remaining: $<c:out value="${selectedBill.getAmount() - selectedBill.getAmountPaid()}"/>)</p>
            <p>Description: <input type="text" name="description" readonly="readonly" value="BILLPAYMENT"/></p>
            <input type="submit" value="Submit" />
        </form>
        <p><a href="main">Back to Main Menu</a></p>
    </body>
</html>